import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import('@/views/Index.vue'),
    children: [
      {
        path: '/user',
        name: 'User',
        component: () => import('@/views/sys/user/Index.vue')
      },
      {
        path: '/brand',
        name: 'Brand',
        component: () => import('@/views/pms/brand/Index.vue')
      },
      {
        path: '/category',
        name: 'Category',
        component: () => import('@/views/pms/category/Index.vue')
      },
      {
        path: '/product',
        name: 'Product',
        component: () => import("@/views/pms/product/Index.vue")
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
